package book;

public class BookList {
    //用数组来放书
    private Book[] books = new Book[10];
    private int booksize;//有效个数
    //初始化三本书放在书架
    public BookList(){
        this.books[0] = new Book("三国演义","罗贯中",35,"小说");
        this.books[1] = new Book("西游记","吴承恩",12,"小说");
        this.books[2] = new Book("红楼梦","曹雪芹",26,"小说");

        this.booksize = 3;
    }

    public Book getBook(int pos) {
        return books[pos];
    }

    public void setBook(int pos,Book book) {
        this.books[pos] = book;
    }

    public int getBooksize() {
        return booksize;
    }

    public void setBooksize(int booksize) {
        this.booksize = booksize;
    }

    public Book[] getBooks() {
        return books;
    }
}
